<template>
  <div class="standard_wage">
    <div class="tool">
      <ToolBar :add-data="setDialogVisible" :update-data="updateById" :delete-data="deleteById"
               :add-batch-data="addBatchData" show-add show-multiple :delete-disable="multipleSelection.length<=0"
               :update-disable="multipleSelection.length!==1"></ToolBar>
    </div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane name="month" label="月度数据">
        <div class="select">
          <el-form :inline="true" :model="form" class="demo-form-inline">
            <el-form-item label="薪资年月">
              <el-date-picker size="small"
                              :clearable="false"
                              v-model="form.date"
                              type="month"
                              @change="handleCurrentChange(1)"
                              placeholder="选择月">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="员工姓名">
              <el-select v-model="form.jobNos" placeholder="请选择员工姓名..." value-key="id" @change="handleCurrentChange(1)" multiple :collapse-tags="true" style="width: 20vw;"
                         size="small"
                         filterable clearable>
                <el-option :label="item.userName+'（'+item.jobNo+'）'" :value="item.jobNo" v-for="item in $store.state.userList">
                  <span style="float: left">{{ item.userName }}</span>
                  <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNo }}</span>
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="handleCurrentChange(1)" size="small">筛选</el-button>
              <el-button type="primary" @click="reSet" icon="el-icon-refresh" size="small">重置
              </el-button>
              <el-button type="primary" icon="el-icon-download" size="small">拉取
              </el-button>
            </el-form-item>

            <el-dialog title="数据搜索" :visible.sync="dialogFormVisible" center>
              <el-row>
                <el-form :model="form">
                  <el-col :span="12">
                    <el-form-item label="入职时间" :label-width="formLabelWidth">
                      <el-date-picker
                          class="w100"
                          v-model="form.hiredDate"
                          align="right"
                          type="date"
                          placeholder="选择日期"
                          :picker-options="pickerOptions">
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="档案时间" :label-width="formLabelWidth">
                      <el-date-picker
                          class="w100"
                          v-model="form.archivesDate"
                          align="right"
                          type="date"
                          placeholder="选择日期"
                          :picker-options="pickerOptions">
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="员工姓名" :label-width="formLabelWidth">
                      <el-select v-model="form.name" placeholder="请选择员工姓名..." value-key="id"
                                 @change="handleUserChange" filterable clearable class="w100">
                        <el-option :label="item.name" :value="item.name" v-for="item in dingUsersList" :key="item.id">
                          <span style="float: left">{{ item.name }}</span>
                          <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
                        </el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="考勤结果" :label-width="formLabelWidth">
                      <el-select v-model="form.timeResult" placeholder="请选择考勤结果..." value-key="id" filterable
                                 clearable class="w100">
                        <el-option :label="item.label" :value="item.value" v-for="item in timeResultList"
                                   :key="item.id">
                          <span style="float: left">{{ item.label }}</span>
                          <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
                        </el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                </el-form>
              </el-row>
              <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="getDataList">确 定</el-button>
              </div>
            </el-dialog>
          </el-form>
        </div>
        <el-table
            :data="tableData"
            stripe
            border
            default-expand-all
            @selection-change="handleSelectionChange"
            :header-cell-style="{'text-align':'center'}"
            :cell-style="{'text-align':'center'}">
          <el-table-column type="selection" width="50" label="序号">
          </el-table-column>
          <el-table-column label="姓名" prop="userName">
          </el-table-column>
          <el-table-column label="工号" prop="jobNo">
          </el-table-column>
          <el-table-column label="年份" prop="yearDate"></el-table-column>
          <el-table-column label="月份" prop="monthDate"></el-table-column>
          <el-table-column label="基础工资" prop="baseSalary">
          </el-table-column>
          <el-table-column label="在职补贴" prop="onJobSubsidy">
          </el-table-column>
          <el-table-column label="岗位补贴" prop="postSubsidy">
          </el-table-column>
          <el-table-column label="效益津贴" prop="benefitAllowance">
          </el-table-column>
          <el-table-column label="油费补贴" prop="oilSubsidy">
          </el-table-column>
          <el-table-column label="合计" prop="subTotal">
          </el-table-column>

          <el-table-column label="创建时间" min-width="100">
            <template slot-scope="scope">
              {{ scope.row.createTime|formatDate }}
            </template>
          </el-table-column>
          <el-table-column label="操作" min-width="120">
            <template slot-scope="scope">
              <el-button
                  size="mini"
                  @click="handleEdit(scope.$index, scope.row)">编辑
              </el-button>
              <el-button
                  size="mini"
                  type="danger"
                  @click="handleDelete(scope.$index, scope.row)">删除
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <div class="block">
          <el-pagination
              hide-on-single-page
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[10, 20, 30, 40]"
              :page-size=size
              layout="total, sizes, prev, pager, next, jumper"
              :total=total>
          </el-pagination>
        </div>
      </el-tab-pane>
      <el-tab-pane name="year" label="年度数据">
        <el-form :inline="true">
          <el-form-item label="薪资年份">
            <el-date-picker size="small"
                v-model="year"
                type="year"
                placeholder="选择年" @change="handleCurrentChange(1)">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="姓名">
            <el-input v-model="form.userName" clearable @change="handleCurrentChange(1)" size="small"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button @click="handleCurrentChange(1)" type="primary" size="small">筛选</el-button>
          </el-form-item>
        </el-form>
        <el-table :data="tableData2" border :header-cell-style="{'text-align':'center'}"
                  :cell-style="{'text-align':'center'}">
          <el-table-column label="姓名" prop="userName"></el-table-column>
          <el-table-column label="工号" prop="jobNo"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.1'" prop="january"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.2'" prop="february"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.3'" prop="march"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.4'" prop="april"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.5'" prop="may"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.6'" prop="june"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.7'" prop="july"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.8'" prop="august"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.9'" prop="september"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.10'" prop="october"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.11'" prop="november"></el-table-column>
          <el-table-column :label="year.getFullYear()+'.12'" prop="december"></el-table-column>
        </el-table>
        <div class="block">
          <el-pagination
              hide-on-single-page
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[10, 20, 30, 40 ,total]"
              :page-size=size
              layout="total, sizes, prev, pager, next, jumper"
              :total=total>
          </el-pagination>
        </div>
      </el-tab-pane>
    </el-tabs>
    <el-dialog
        top="15vh"
        :visible.sync="standardWage"
        width="50%"
        title="基本工资批量导入"
        center>
      <el-row style="text-align: center!important;margin-bottom: 2rem!important;">
        薪资年月：
        <el-date-picker
            :clearable="false"
            v-model="date"
            type="month"
            placeholder="选择月">
        </el-date-picker>
      </el-row>
      <el-upload
          class="upload-demo"
          drag
          :http-request="uploadStandardWage"
          auto-upload
          accept=".xlsx,.xls"
          multiple action="#" style="text-align: center!important;">
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip" slot="tip">只能上传1个.xls/.xlsx文件</div>
        <el-link type="success" href="https://47.109.16.23:28361/down/Pkdc6tXSf8zC.xlsx" style="margin-top:1rem">
          点击下载标准工资上传模板
        </el-link>

      </el-upload>
    </el-dialog>
    <el-dialog title="提示" :visible.sync="dialogVisible" append-to-body center>
      <div slot="title">
        <h3>提示</h3>
        <h5>上传文件中：
          <el-tag type="info" v-text="allNum"></el-tag>
          条数据，成功导入
          <el-tag type="success" v-text="successNum"></el-tag>
          条数据，失败导入：
          <el-tag type="danger" v-text="errorNum"></el-tag>
          条数据<span v-if="errorNum>0">，错误信息如下：</span></h5>
      </div>
      <el-row>
        <ol v-if="list.length>0" style="text-align: center;height:35vh;overflow-y: scroll;">
          <li v-for="(item,index) in list" style="text-align: left;">
            <span v-text="item" style="width: 350px;overflow: hidden;text-overflow: ellipsis"></span></li>
        </ol>
      </el-row>
    </el-dialog>
    <el-dialog title="标准工资" :visible.sync="dialogFormVisible" :before-close="handleClose">
      <el-form :model="wagesForm" label-position="left" :rules="rules" ref="wagesForm">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="薪资年月" :label-width="formLabelWidth" prop="wagesForm">
              <el-date-picker
                  v-model="form.date"
                  type="month"
                  placeholder="选择月" style="width: 100%">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工选择" :label-width="formLabelWidth" prop="wagesForm">
              <el-select v-model="people" placeholder="请选择员工姓名..." value-key="jobNumber"
                         @change="handleUserChange"
                         filterable clearable style="margin-top: 0.2rem;margin-right: 0.5rem;width: 100%">
                <el-option :label="item.name+'('+item.jobNumber+')'" :value="item" v-for="item in dingUsersList"
                           :key="item.id">
                  <span style="float: left">{{ item.name }}</span>
                  <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工姓名" :label-width="formLabelWidth" prop="userName">
              <el-input v-model="wagesForm.userName" autocomplete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工工号" :label-width="formLabelWidth" prop="jobNo">
              <el-input v-model="wagesForm.jobNo" autocomplete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="基础工资" :label-width="formLabelWidth" prop="baseSalary">
              <el-input v-model="wagesForm.baseSalary" autocomplete="off" type="number" @blur="sumSubTotal"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="在职补贴" :label-width="formLabelWidth" prop="onJobSubsidy">
              <el-input v-model="wagesForm.onJobSubsidy" autocomplete="off" type="number"
                        @blur="sumSubTotal"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="岗位补贴" :label-width="formLabelWidth" prop="postSubsidy">
              <el-input v-model="wagesForm.postSubsidy" autocomplete="off" type="number" @blur="sumSubTotal"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="油费补贴" :label-width="formLabelWidth" prop="oilSubsidy">
              <el-input v-model="wagesForm.oilSubsidy" autocomplete="off" type="number" @blur="sumSubTotal"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="效益津贴" :label-width="formLabelWidth" prop="benefitAllowance">
              <el-input v-model="wagesForm.benefitAllowance" autocomplete="off" type="number"
                        @blur="sumSubTotal"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="小计" :label-width="formLabelWidth" prop="subTotal">
              <el-input v-model="wagesForm.subTotal" autocomplete="off" type="number"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="备注" :label-width="formLabelWidth" prop="summary">
              <el-input v-model="wagesForm.summary" autocomplete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="handleClose">取 消</el-button>
        <el-button type="primary" @click="isAdd?addData('wagesForm'):updateById('wagesForm')">确 定 <span
            v-text="isAdd?'添 加':'修 改'"></span></el-button>

      </div>
    </el-dialog>
  </div>
</template>

<script>
import ToolBar from "@/components/common/ToolBar";
import UpLoadDialogComponent from "@/components/common/UpLoadDialogComponent";
import moment from "moment/moment";

export default {
  name: "FinStandardWage",
  components: {ToolBar, UpLoadDialogComponent},
  data() {
    return {
      activeName: "month",
      dialogVisible: false,
      list: [],
      allNum: 0,
      successNum: 0,
      errorNum: 0,
      currentPage: 1,
      total: 0,
      size: 10,
      tableData: [],
      dingUsersListName: null,
      dingUsersList: [],
      userList: [],
      pickerOptions: {
        shortcuts: [
          {
            text: '今天',
            onClick(picker) {
              picker.$emit('pick', new Date());
            }
          }, {
            text: '昨天',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit('pick', date);
            }
          }, {
            text: '一周前',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', date);
            }
          },
          {
            text: '一个月前',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit('pick', date);
            }
          }]
      },
      dialogFormVisible: false,
      form: {
        start: null,
        end: null,
        userId: null,
        name: null,
        workDate: null,
        timeResult: null,
        checkType: null,
        archivesDate: moment(moment().subtract(1, "months").startOf('month')).format("YYYY-MM-DD"),
        hiredDate: null,
        date: moment(moment().subtract(1, "months").startOf('month')).format("YYYY-MM-DD"),
      },
      rules: {
        baseSalary: [{
          required: true, message: "请输入基础工资...", trigger: "blur"
        }],
        benefitAllowance: [{
          required: true, message: "请输入效益津贴...", trigger: "blur"
        }],
        jobNo: [{
          required: true, message: "请输入员工工号...", trigger: "blur"
        }],
        oilSubsidy: [{
          required: true, message: "请输入油费补贴...", trigger: "blur"
        }],
        onJobSubsidy: [{
          required: true, message: "请输入在职补贴...", trigger: "blur"
        }],
        postSubsidy: [{
          required: true, message: "请输入岗位补贴...", trigger: "blur"
        }],
        subTotal: [{
          required: true, message: "请输入参数名称...", trigger: "blur"
        }],
        userName: [{
          required: true, message: "请输入员工姓名...", trigger: "blur"
        }],
      },
      wagesForm: {
        baseSalary: 0,
        benefitAllowance: 0,
        createUserId: this.$store.state.userInfo.id,
        jobNo: null,
        monthDate: 0,
        oilSubsidy: 0,
        onJobSubsidy: 0,
        postSubsidy: 0,
        subTotal: 0,
        summary: null,
        userName: null,
        yearDate: 0
      },
      people: {},
      formLabelWidth: '85px',
      timeResultList: [
        {
          label: "正常",
          value: "Normal",
        },
        {
          label: "早退",
          value: "Early",
        }, {
          label: "迟到",
          value: "Late",
        }, {
          label: "严重迟到",
          value: "SeriousLate",
        }, {
          label: "旷工迟到",
          value: "Absenteeism",
        }, {
          label: "未打卡",
          value: "NotSigned",
        },
      ],
      multipleSelection: [],
      standardWage: false,
      date: new Date(),
      isAdd: true,
      tableData2: [],
      year: new Date(),
    }
  },
  watch: {
    date: {
      handler(newVal, oldVal) {
        console.log("Date:", this.date)
      }
    }
  },
  created() {
    const date = new Date();
    date.setTime(date.getTime() - 3600 * 1000 * 24);
    this.form.archivesDate = date
    this.activeName = this.$store.state.standardWagesActiveName || "month"
    this.getDataList()

  },
  mounted() {

  },
  methods: {
    handleClick(tab, event) {
      this.$store.commit("setStandardWagesActiveName", this.activeName)
      this.getDataList()
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleEdit(index, row) {
      console.log(index, row);
      this.isAdd = false
      this.wagesForm = row
      this.people = {
        jobNumber: this.wagesForm.jobNo,
        name: this.wagesForm.userName
      }
      this.form.date = new Date(this.wagesForm.yearDate, this.wagesForm.monthDate - 1, 1)
      this.dialogFormVisible = true
    },
    handleDelete(index, row) {
      console.log(index, row);
      this.$tools.showMessageBox("确认删除" + row.userName + "(" + row.jobNo + ")？", "操作确认", 'warning').then(confirm => {
        axios.post("/fin_standard_wage/delete/" + this.$store.state.userInfo.id + "/" + this.$store.state.userInfo.name, row).then(res => {
          if (res.data.success) {
            this.$tools.showMessage(res.data.message, "success")
            this.getDataList()
          } else {
            this.$tools.showMessage(res.data.message, "error")
          }
        })

      }).catch(cancel => {
        this.$tools.showMessage("操作已取消！", "info")
      })
    },
    getDataList() {
      switch (this.activeName) {
        case "month":
          this.dialogFormVisible = false
          console.log("查询数据：", this.form)
          axios.post("/fin_standard_wage/list/" + this.currentPage + "/" + this.size, this.form).then(res => {
            console.log("打卡信息：", res)
            if (res.data.success) {
              this.tableData = res.data.data.records
              this.total = res.data.data.total
              this.pages = res.data.data.pages
            } else {
              this.tableData = []
              this.total = 0
              this.pages = 1

            }
          })
          break;
        case "year":
          this.form.year = this.year
          this.form.pageNumber = this.currentPage
          this.form.pageSize = this.size
          axios.post("/fin_standard_wage/list", this.form).then(res => {
            console.log("查询结果：", res)
            if (res.data.success) {
              this.tableData2 = res.data.data.records
              this.total = res.data.data.total
              this.pages = res.data.data.pages
            } else {
              this.tableData2 = []
              this.total = 0
              this.pages = 1

            }
          })
          break;
      }
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.size = val
      this.getDataList()
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.currentPage = val
      this.getDataList()
    },
    goSearch() {
      this.dialogFormVisible = true

    },
    reSet() {
      this.form = {
        start: null,
        end: null,
        userId: null,
        name: null,
        workDate: null,
        timeResult: null,
        checkType: null,
      }
      this.getDataList()

    },
    handleClose(done) {
      console.log("Donw:", done)
      this.$confirm('确认关闭？')
          .then(_ => {
            this.dialogFormVisible = false
            done();
          })
          .catch(_ => {
          });
    },
    handleChange() {
      this.getDataList()
    },
    handleUserChange() {
      console.log("People:", this.people)
      this.wagesForm.userName = this.people.name
      this.wagesForm.jobNo = this.people.jobNumber
    },
    sumSubTotal() {
      this.wagesForm.subTotal = parseFloat(this.wagesForm.baseSalary)
          + parseFloat(this.wagesForm.onJobSubsidy)
          + parseFloat(this.wagesForm.postSubsidy) + parseFloat(this.wagesForm.benefitAllowance) + parseFloat(this.wagesForm.oilSubsidy);
    },
    deleteById() {
      this.$tools.showMessageBox("确认删除" + this.multipleSelection.length + "名用户？", "批量删除确认", "warning").then(confirm => {
        axios.post("/fin_standard_wage/deleteBatch", this.multipleSelection).then(res => {
          console.log("批量删除结果：", res)
          if (res.data.success) {
            this.$tools.showMessage("删除成功！", "success")
            this.getDataList()
          } else {
            this.$tools.showMessage("删除失败！", "danger")
          }
        })
      }).catch(cancel => {
        this.$tools.showMessage("操作已取消！", "info")
      })

    },
    addBatchData() {
      console.log("批量添加")
      this.standardWage = true
    },
    get() {
      axios.get('/fin_user_roster/get').then(res => {
        console.log("YES")
      })
    },
    uploadStandardWage(res) {
      console.log(res)
      const yearDate = this.date.getFullYear()
      const monthDate = this.date.getMonth() + 1

      let formData = new FormData();
      formData.append("file", res.file)
      axios({
        method: "POST",
        url: "/fin_standard_wage/addBatch/" + yearDate + "/" + monthDate + "/" + this.$store.state.userInfo.id + "/" + this.$store.state.userInfo.name,
        headers: {
          'content-type': 'multipart/form-data',
        },
        data: formData
      }).then(res => {
        console.log(res)
        if (res.data.success) {
          let successNum = parseInt(res.data.data.successNum);
          let errorNum = parseInt(res.data.data.errorNum);
          let allNum = successNum + errorNum
          if (errorNum > 0) {
            let list = res.data.data.list
            this.successNum = successNum;
            this.errorNum = errorNum
            this.allNum = allNum;
            this.list = list
            this.dialogVisible = true
          } else {
            this.getDataList()
            this.standardWage = false
            this.$message({
              dangerouslyUseHTMLString: true,
              message: "成功上传<b>" + allNum + "</b>条数据",
              type: "success"
            })
          }
        } else {
          this.$message({
            dangerouslyUseHTMLString: true,
            message: res.data.message,
            type: "error"
          })
        }
      })
    },
    setDialogVisible(isAdd) {
      this.dialogFormVisible = true
      this.isAdd = isAdd
    },
    updateDialogVisible() {
      this.wagesForm = this.multipleSelection[0]
      this.setDialogVisible(false)
    },
    updateById(form) {
      console.log("用户扫描修改:", form)
      this.$refs[form].validate((valid) => {
        if (valid) {
          this.wagesForm.updateUserId = this.$store.state.userInfo.id
          console.log("Wages:", this.wagesForm)
          axios.post("/fin_standard_wage/update/" + this.$store.state.userInfo.id + "/" + this.$store.state.userInfo.name, this.wagesForm).then(res => {
            if (res.data.success) {
              this.$tools.showMessage(res.data.message, "success")
              this.dialogFormVisible = false
              this.getDataList()
              this.wagesForm = {}
            } else {
              this.$tools.showMessage(res.data.message, "danger")

            }
          })
        } else {
          this.$tools.showMessage("请检查您输入的信息...", "warning")
        }
      })
    },
    addData(form) {
      this.wagesForm.yearDate = moment(this.form.date).year()
      this.wagesForm.monthDate = moment(this.form.date).month() + 1
      console.log("WagesForm:", this.wagesForm)
      this.$refs[form].validate((valid) => {
        if (valid) {
          this.wagesForm.createUserId = this.$store.state.userInfo.id
          axios.post("/fin_standard_wage/add/" + this.$store.state.userInfo.id + "/" + this.$store.state.userInfo.name, this.wagesForm).then(res => {
            if (res.data.success) {
              this.$tools.showMessage(res.data.message, "success")
              this.dialogFormVisible = false
              this.getDataList()
            } else {
              this.$tools.showMessage(res.data.message, "danger")

            }
          })

        } else {
          this.$tools.showMessage("请检查您输入的信息...", "warning")
        }
      })
    }
  }

}
</script>

<style scoped lang="less">
.standard_wage {
  .select {
    //margin-bottom: 0.5rem;
    display: inline-flex !important;
  }
}
</style>
